/**
 * @author liangxi
 * @since 2024/7/22
 */

#ifndef DESIGNPATTERN_V1MACHINE_H
#define DESIGNPATTERN_V1MACHINE_H


#include <iostream>
#include "../Machine.h"

class V1Machine : public Machine{

public:
    void exec() override {
        std::cout << "V1Machine" << std::endl;
    }

    std::shared_ptr<Machine> clone() override {
        //以当前合适状态的对象去创建一个新的副本 用那个副本执行exec
        std::shared_ptr<Machine> ptr = std::make_shared<V1Machine>(*this);
        return ptr;
    }

private:

};


#endif //DESIGNPATTERN_V1MACHINE_H
